<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<div style="display: none"><script id="myEditorImage" type="text/plain"></script></div> 
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<form method="post" action="${rootUrl}/goods/goods-class/${goodsClass.id}" class="pageForm required-validate" onsubmit="return validateCallback(this, editDialogTree);">
		<input type="hidden" name="_method" value="put">
		<input type="hidden" id="goodsClassid" name="goodsClass.id" value="${goodsClass.id}">
		<div class="pageFormContent" layoutH="56">
			<p>
				<label>商品类别名称：</label>
				<input name="goodsClass.name" class="required" type="text" size="30" value="${goodsClass.name}"/>
			</p>
	       <dl class="nowrap">
				<dt>商品类别图片：</dt>
				<dd style="width: 300px;">
				<input name="goodsClass.image" id="ab"  type="hidden" size="30" value="${goodsClass.image}"/>
				<div class="imgContainer" >
				<a href="#" onclick="iFileUploader.upImg('ab','myEditorImagessmm');"><img id="myEditorImagessmm" src="${goodsClass.image}"/></a>
				</div>
				</dd>
			</dl>
			<p>
				<label>商品类别排序：</label>
				<input name="goodsClass.sort" class="required" type="text" size="30" value="${goodsClass.sort}"/>
			</p>
			<p>
				<label>是否展示：</label>
				<select name="goodsClass.isShow" class="required combox">
					<option <c:if test="${goodsClass.isShow == 1}">selected="selected"</c:if> value="1">是</option>
					<option <c:if test="${goodsClass.isShow == 0}">selected="selected"</c:if> value="0">否</option>
				</select>
			</p>
		
            <p>
			   <label>商品类别品牌：</label>
			   <input class="goods_class_brand" type="hidden"><a class="btnLook" style="float:left" href="javascript:openGoodsClassBrand()">编辑类别品牌</a></input>
			</p>
            <p>
			   <label>商品类别属性：</label>
			   <input class="class_attr" type="hidden"><a class="btnLook" style="float:left" href="javascript:openClassAttr()">编辑类别属性</a></input>
			</p>
		</div>
		<div class="formBar">
			<ul>
				
				<li>
				<a title="确定要删除吗?" target="dialogAjaxTodo" callback="editDialogTree" href="${rootUrl}/goods/goods-class/${goodsClass.id}?_method=delete"><div class="button"><div class="buttonContent"><button type="button" >删除</button></div></div></a>
				</li>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
			</ul>
		</div>
	</form>
	
<script>
var imageFolder = 0;
iFileUploader.initImg("myEditorImage","ab","myEditorImagessmm",{imageFolder:imageFolder});
function openGoodsClassBrand(){
	if($("#goodsClassid").val() != 0){
		$.pdialog.open("${rootUrl}/goods/brand-goods-class?goodsClassId="+$("#goodsClassid").val(),"brand_goods_class","商品类别品牌",{width:800,height:600});
	}else{
		alert("在保存过商品类别后才可添加品牌");
	}
}
function openClassAttr(){
if($("#goodsClassid").val() != 0){
	$.pdialog.open("${rootUrl}/goods/goods-class-attr?goodsClassId="+$("#goodsClassid").val(),"goods_class_attr","商品类别属性",{width:800,height:600});
}else{
	alert("在保存过商品类别后才可添加属性");
}
}
function saveCallBack(json){
		DWZ.ajaxDone(json);
	$("#goodsClassId").val(json.goodsClassId);
	}
</script>